package com.atguigu.demo0428.customer.mapper;

import com.atguigu.demo0428.customer.bean.Customer;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("mysql0428")
public interface CustomerMapper extends BaseMapper<Customer> {

    @Insert("insert into customer  values (#{cus.id}, #{cus.customerName},#{cus.customerAge})")
    @DS("mysql0224")
    public void insertCustomer(@Param("cus") Customer customer);

    @Select("select id,customer_name,customer_age from customer where customer_name =#{customerName}")
    public List<Customer>  getCustomerList(@Param("customerName") String customerName);

    //delete

    // update

}
